/**
 * 
 */
package com.xbang.attendance.dao;

import java.util.List;

import com.xbang.attendance.entity.role.Resource;
import com.xbang.attendance.entity.role.User;
import com.xbang.attendance.entity.system.Menu;
import com.xbang.core.dao.annotation.Sentence;

import enumeration.ResourceType;

/**
 * @author dev.zhang
 */
public interface SystemDao {

    @Sentence("FROM Menu menu WHERE menu.parent is null AND menu.disabled = false")
    public List<Menu> listMenus();
    
    @Sentence("FROM Menu menu WHERE menu.parent is not null AND menu.disabled = false")
    public List<Menu> listSubmenus();
    
    @Sentence("FROM User user WHERE user.name = :name AND user.disabled = false")
    public List<User> getUserByName(String name);
    
    @Sentence("FROM Resource resource WHERE resource.type = :type")
    public List<Resource> listUrlResources(ResourceType type);

}
